WOLF core
WOLF: A Modular Estimation Framework for Robotics
XXXXXXXXXXXXXXXXXXXXXXXXvoid(0)" frameborder="0" name="MSearchResults" id="MSearchResults">
eigen_assert.h
Go to the documentation of this file.
1// WOLF - Copyright (C) 2020-2026
2// Institut de Robòtica i Informàtica Industrial, CSIC-UPC.
3// Authors: Joan Solà Ortega (jsola@iri.upc.edu) and
4// Joan Vallvé Navarro (jvallve@iri.upc.edu)
5// All rights reserved.
6//
7// This file is part of WOLF: http://www.iri.upc.edu/wolf
8// WOLF is free software: you can redistribute it and/or modify
9// it under the terms of the GNU General Public License version 3
10// as published by the Free Software Foundation.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program. If not, see <http://www.gnu.org/licenses/>.
19#pragma once
20
21#include <Eigen/Dense>
22
23namespace Eigen
24{
26
60template <int Size, int DesiredSize>
62{
63 template <typename T>
65 {
66 static_assert(Size == DesiredSize, "Size of static Vector or Matrix does not match");
67 }
68};
69
70template <int DesiredSize>
71struct StaticDimCheck<Eigen::Dynamic, DesiredSize>
72{
73 template <typename T>
74 StaticDimCheck(const T& t)
75 {
76 if (t != DesiredSize) std::cerr << "t : " << t << " != DesiredSize : " << DesiredSize << std::endl;
77 assert(t == DesiredSize && "Size of dynamic Vector or Matrix does not match");
78 }
79};
80
81template <int DesiredR, int DesiredC>
83{
92 template <typename T>
93 static void check(const Eigen::MatrixBase<T>& t)
94 {
97 }
98};
99
100template <int Dim>
102
103template <int Dim>
105
106} /* namespace Eigen */
Namespace extending Eigen definitions.
Definition: wolf.h:94
Definition: eigen_assert.h:83
static void check(const Eigen::MatrixBase< T > &t)
Assert matrix size dynamically or statically.
Definition: eigen_assert.h:93
StaticDimCheck(const T &t)
Definition: eigen_assert.h:74
Definition: eigen_assert.h:62
StaticDimCheck(const T &)
Definition: eigen_assert.h:64